//
//  UILabel+Extension.swift
//  SainMicroblog
//
//  Created by chenxinju on 16/5/7.
//  Copyright © 2016年 chenxinju-a2. All rights reserved.
//

import UIKit

extension UILabel {

      //便利构造函数 便利构造函数需要借助其他函数完成初始化
    convenience init(size:CGFloat,color:UIColor,singleLine:Bool){
    
    self.init()
    
        self.font = UIFont.systemFontOfSize(size)
        
        self.textColor = color
        
        if singleLine {
        
           self.numberOfLines = 1
        }else {
        
           self.numberOfLines = 0
        }
    }
}